package myUtils;

import java.util.List;

import com.github.pagehelper.PageInfo;

public class myPage {
	public static int PAGE = 1;
	public static int PAGENUM = 10;
	private long total = 0;
	private int page = 1;
	private int pageNum = 10;
	public myPage(long total, int page, int pageNum) {
		this.total = total;
		this.page = page;
		this.pageNum = pageNum;
	}
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		this.page = page;
	}
	public int getPageNum() {
		return pageNum;
	}
	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}
	public static <T> myPage pageInfo(List<T> data) {
		PageInfo pageEntity = new PageInfo(data);
		return new myPage(pageEntity.getTotal(), pageEntity.getPageNum(), pageEntity.getPageSize());
	}
}
